package pl.easyshop.core.services.category;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import pl.easyshop.core.services.AbstractBaseData;

/**
 * Category view data.
 * 
 * @author Pawel Witkowski
 */
public class CategoryData extends AbstractBaseData {

	/** Unique serialization identifier. */
	private static final long serialVersionUID = -7129777384016234024L;

	/** Category label (name). */
	private String label;
	
	/** Value <code>true</code> means {@link #label} field is a resource code in properties file. */
	private boolean resourceBoundleCode;
	
	/** If set <code>false</code> means category is not expected to display in front-end. */
	private boolean enabled;
	
	/** Parent category. */
	private Long parentCategoryId;
	
	/**
	 * Get label property value.
	 * @return the label
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * Set label property value.
	 * @param label the label to set
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/**
	 * Get resourceBoundleCode property value.
	 * @return the resourceBoundleCode
	 */
	public boolean isResourceBoundleCode() {
		return resourceBoundleCode;
	}

	/**
	 * Set resourceBoundleCode property value.
	 * @param resourceBoundleCode the resourceBoundleCode to set
	 */
	public void setResourceBoundleCode(boolean resourceBoundleCode) {
		this.resourceBoundleCode = resourceBoundleCode;
	}

	/**
	 * Get enabled property value.
	 * @return the enabled
	 */
	public boolean isEnabled() {
		return enabled;
	}

	/**
	 * Set enabled property value.
	 * @param enabled the enabled to set
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	/**
	 * Get parentCategoryId property value.
	 * @return the parentCategoryId
	 */
	public Long getParentCategoryId() {
		return parentCategoryId;
	}

	/**
	 * Set parentCategoryId property value.
	 * @param parentCategoryId the parentCategoryId to set
	 */
	public void setParentCategoryId(Long parentCategoryId) {
		this.parentCategoryId = parentCategoryId;
	}
	
	
	@Override
	public String toString() {
		ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		builder.appendSuper(super.toString());
		builder.append("label", label);
		builder.append("resourceBoundleCode", resourceBoundleCode);
		builder.append("parentCategoryId", parentCategoryId);
		return builder.toString();
	}

}
